<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    //1. 获取一个 CancelToken 工厂类
    const CancelToken = axios.CancelToken;
    // 2. 通过 CancelToken 获取source
    const source = CancelToken.source();
    axios.post(
        "http://s.linweiqin.com/api/s/getIndexLoopimg",
        {
          data: 123,
        },
        {
          /* 3. 配置cancelToken */
          cancelToken: source.token,
        }
    ).then((res)=>{
        console.log(res);
    }).catch(res=>{
        console.log(err);
    })


</script>

</html>